<!DOCTYPE HTML>
<html>
<head>
    <!-- 电子券主题创建页面 -->
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />-->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../ht-css/Project.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../ht-css/style-q.css"/>
    <link rel="stylesheet" type="text/css" href="../../lib/My97DatePicker/4.8/skin/WdatePicker.css"/>
    <title>电子券管理</title>
    <style>
        label.error{
        right: auto;
        width: 150px;
        left: 0;
        top: 0;
        position:relative;
    }
        .tip{
            color: red;
        }


    </style>
</head>
<body>
<nav class="breadcrumb">电子券管理 <span class="c-gray en">&gt;</span> 电子券主题创建<a class="btn btn-success radius r"
                                                                            style="line-height:1.6em;margin-top:3px"
                                                                            href="javascript:location.replace(location.href);"
                                                                            title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="coupon-add">
        <div>
            <div class="bg-1 bk-gray pd-20 mb-20">
                <div class="va-m lh-20 f-16 pb-15">
                    <strong>基本信息</strong>
                </div>
                <div class="line"></div>
                <table class="table-hover mb-10 mt-10 table">
                    <thead class="text-l">
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5">电子券主题编码：</label>
                                <span class="f-l pt-5" name="topicCode" id="topicCode">----</span>
                            </div>
                        </td>
                        <td class="col-4-1">
                            <label class="form-label f-l pt-5">类型：</label>
                            <span class="select-box size-M radius col-xs-8" style="width:70%">
                  <select class="select" name="brandclass" size="1" name="topicType" id="topicType" onclick="getTopicType()">
                    <option value="10" selected="">满减券</option>
                    <option value="20">运费券</option>
                  </select>
                </span>
                        </td>
                        <td class="col-4-1">
                            <label class="form-label f-l pt-5">制券人：</label>
                            <span class="f-l pt-5" name="createUsername" id="createUsername"></span>
                        </td>
                        <td class="col-4-1">
                            <label class="form-label f-l pt-5">制券部门：</label>
                            <span class="f-l pt-5" name="createDept" id="createDept"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>名称：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius" name="couponName" id="topicName"
                                           placeholder="输入" maxlength="50"><span id="message0" class="tip"></span>
                                </div>
                            </div>
                        </td>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>面额：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius" name="amount" id="amount"
                                           placeholder="输入" onblur="if(this.value==0){this.value=''}"><span id="message"
                                                                                        class="tip"></span>
                                </div>
                            </div>
                        </td>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>数量：</label>
                                <div class="formControls f-l">
                                    <input type="text" class="input-text radius" name="totalCount" id="totalCount"
                                           placeholder="输入"  onafterpaste="this.value=this.value.replace(/\D/g,'')" onblur="if(this.value==0){this.value=''}"><span id="message2"  class="tip"></span>
                                </div>
                            </div>
                        </td>
                        <td class="col-4-1">
                            <span class="f-l pt-5 ">共计生成优惠金额<span id="countPrice" class="ml-10 mr-10 c-red"></span>元</span>
                        </td>
                    </tr>
                    </thead>
                </table>
                <div class="pd-20">
                    <div class="clearfix mb-15">
                        <label class="f-l pt-5">描述：</label>
                        <div class="formControls col-sm-5">
                            <textarea name="description" id="description" class="textarea" title="" maxlength="200"></textarea></div>
                    </div>
                    <div class="clearfix mb-15 skin-minimal">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>使用门槛：</label>
                        <div class="radio-box f-l mt-5">

                                <input type="radio" id="radio-1" name="demoradio1" value="1" onclick="noCondition()">

                            <label for="radio-1" class="">不限制</label>
                        </div>

                        <div class="radio-box f-l mt-5 pl-30">

                                <input type="radio" id="radio-2" name="demoradio1" value="2">

                            <label for="radio-2" class="" id="orderMoney">单笔订单适用商品金额满</label>
                        </div>
                        <div class="formControls f-l ml-10">
                            <input type="text" class="input-text" value="" placeholder="请输入金额" id="useCondition"
                                   name="useCondition" onblur="if(this.value==0){this.value=''}">
                        </div>
                        <span class="f-l pd-5">元使用</span><div id="error_message_2"></div>
                    </div>
                    <div  class="clearfix mb-15 skin-minimal">
                        <label class="form-label f-l text-r w-60 lh-26 pl-15" style="width: 96px;padding-left: 0px " ><span class="c-red pr-5 f-l" >*</span>适用支付方式：</label>
                        <div class="formControls f-l ml-10 lh-26" id="applPaidType" >
                            <label><input type="checkbox" value="1001,1301,1701" name="applPaidType" id="applPaidType0" onclick="check_pay()"/>全部&nbsp;&nbsp;</label>
                            <label><input type="checkbox" value="1001" name="paidType"/>在线支付&nbsp;&nbsp;</label>
                            <label><input type="checkbox" value="1301" name="paidType"/>线下汇款&nbsp;&nbsp;</label>
                           <!-- <label><input type="checkbox" value="1401" name="paidType"/>银行汇票&nbsp;&nbsp;</label>
                            <label><input type="checkbox" value="1101" name="paidType"/>货到付款&nbsp;&nbsp;</label>
                            <label><input type="checkbox" value="1201" name="paidType"/>账期支付&nbsp;&nbsp;</label>-->
                            <label><input type="checkbox" value="1701" name="paidType"/>货到付款&nbsp;&nbsp;</label>
                        </div>
                    </div>
                    <div class="clearfix mb-15 skin-minimal" id="priceType">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>适用价格类型：</label>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="bos--" name="priceType" value="0">
                            <label for="box-1" class="" >不限</label>
                        </div>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="bos" name="priceType" value="20">
                            <label for="box-1" class="" >现金价</label>
                        </div>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="bos-" name="priceType" value="10">
                            <label for="box-1" class="" >售价</label>
                        </div>
                    </div>
                    <div class="clearfix mb-15 skin-minimal" id="automatic">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>是否抽奖自动发券使用：</label>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="box-4" name="automatic" value="20">
                            <label for="box-1" class="" >是</label>
                        </div>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="box-5" name="automatic" value="10">
                            <label for="box-1" class="" >否</label>
                        </div>
                    </div>
                    <div class="clearfix mb-15">
                        <label class="f-l pt-5">使用说明：</label>
                        <div class="formControls col-sm-5">
                            <textarea name="introduction" id="introduction" class="textarea" title="" maxlength="50"></textarea></div>
                    </div>
                    <div class="clearfix mb-15 skin-minimal">
                        <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>适用品类说明：</label>
                        <div class="formControls f-l">
                            <input type="text" class="input-text radius" name="applCategoryIntroduce"
                                   id="applCategoryIntroduce"
                                   placeholder="" maxlength="25" width="90%" onblur="if(this.value==0){this.value=''}" ><!--onkeyup="checkLength(this, 25);"-->
                            <span id="message11" class="tip"></span>
                        </div>
                    </div>
                    <div class="clearfix mb-15 skin-minimal">
                        <label class="form-label f-l pt-5">指向专题URL：</label>
                        <div class="formControls f-l">
                            <input type="text" class="input-text radius" name="topicUrl" id="topicUrl"
                                   placeholder="" maxlength="1000" width="90%"><span id="message12" class="tip"></span>
                        </div>
                    </div>
                </div>

                <div class="va-m lh-20 f-16 pb-15">
                    <strong>用券规则</strong>
                </div>
                <div class="line"></div>
                <div class="pd-20">
                    <div>
                        <div class="clearfix mb-15 skin-minimal">
                            <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>生效日期：</label>
                            <div class="radio-box f-l mt-5">
                                    <input type="radio" id="radio-3" name="demoradio2" value="1" onclick="setDayDate()">
                                <label for="radio-3" class="">固定日期</label>
                            </div>
                            <div class="radio-box f-l mt-5 pl-30">
                                    <input type="radio" id="radio-4" name="demoradio2" value="2" onclick="setDayNum()" >
                                <label for="radio-4" class=""><span class="">领到券当日开始</span>
                                    <span class="formControls ">
                                     <input type="text" class="input-text" name="dayNumber" id="dayNumber" value="" placeholder="" style="width:60px; margin:-5px 5px 0"  maxlength="3">
                                    </span>
                                    <span class="">天内有效</span><div id="error_message_1"></div></label>
                            </div>
                        </div>
                        <div class="clearfix mb-15 skin-minimal" id="timeDate" hidden>
                            <label class="f-l" style="width:100px">&nbsp;</label>
                            <div class="" id="date">
                                <label class="form-label f-l pt-5">生效时间：</label>
                                <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'logmax\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" id="logmin" name="logmin" class="input-text Wdate radius f-l" style="width:180px;" placeholder="请选择时间" autocomplete="off">
                                <label class="form-label f-l pt-5 pl-5">过期时间：</label>
                                <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',dateFmt:'yyyy-MM-dd HH:mm:ss' })" id="logmax" class="input-text Wdate radius f-l" style="width:180px;" placeholder="请选择时间" name="logmax" autocomplete="off">
                            </div>
                        </div>
                    </div>

                    <div class="clearfix mb-15 skin-minimal" id="applPort">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>适用端口：</label>
                        <div class="check-box f-l mt-5">
                            <input type="radio" id="box-1" name="applPort" value="0">
                            <label for="box-1" class="" >不限</label>
                        </div>
                        <div class="check-box  mt-5 pl-30">
                                <input type="radio" id="box-2" name="applPort" value="1">
                            <label for="box-2" class="" >电脑端</label>
                        </div>
                        <div class="check-box  mt-5 pl-30">
                            <input type="radio" id="box-3" name="applPort" value="2">
                            <label for="box-3" class="" >移动端</label>
                        </div>
                    </div>

                    <div class="clearfix mb-15 skin-minimal" id="applRange">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>适用商品：</label>
                        <div class="radio-box f-l mt-5">

                                <input type="radio" id="radio-5" name="applRange"  value="1">

                            <label for="radio-5" class="">指定品类</label>
                        </div>
                        <!--<div class="check-box f-l mt-5 pl-30">
                                <input type="radio" id="radio-6" name="applRange" value="2">
                            <label for="radio-6" class="">指定场景</label>
                        </div>-->
                        <div class="f-l mt-5 pl-30"><a  href="javascript:;" class="pr-20" id="selectAll">全选</a><a  href="javascript:;" id="selectReset">重置</a></div>
                    </div>

                    <div class="clearfix mb-15l" style="padding-left:88px;" >
                        <div class="clearfix mb-15 skin-minimal" style="padding-left:-80px;" id="applCate">
                            <label class="f-l pt-5"></label>
                            <div class="radio-box f-l mt-5">

                                    <input type="radio" id="radio-7" name="applCate"  value="1" >

                                <label for="radio-7">适用选择品类</label>
                            </div>
                            <div class="check-box f-l mt-5 pl-30">

                                    <input type="radio"  id="radio-8" name="applCate" value="2">

                                <label for="radio-8" class=""  >排除选择品类</label>
                            </div>
                        </div>
                        <!--<div class="clearfix pb-20">
                            <div class="class-wp27 class-sx f-l">
                                <div class="pd-5"><strong>属性项</strong></div>
                                <ul class="bk-gray pt-5" style="height:372px">
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                            <div class="class-wp27 class-sx f-l">
                                <div class="pd-5"><strong>属性项</strong></div>
                                <ul class="bk-gray pt-5">
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                            <div class="class-wp27 class-sx f-l">
                                <div class="pd-5"><strong>属性项</strong></div>
                                <ul class="bk-gray pt-5">
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                            <div class="class-wp27 class-sx f-l">
                                <div class="pd-5"><strong>属性项</strong></div>
                                <ul class="bk-gray pt-5">
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                    <li class="clearfix pl-10 mb-5">
                                        <div class="f-l pd-5"><input name="classification01" type="radio" value="" class="radio"/><label class="pl-10">14 化工</label>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>-->
                        <div class="clearfix pb-20" id="cateLevel">
                            <div class="class-wp27 f-l">
                                <div class="pd-5"><strong>一级品类名称</strong></div>
                                <ul class="bk-gray pt-5" id="classSet1"></ul>
                            </div>
                            <div class="class-wp27 f-l" style="display: none" id="classDiv2">
                                <div class="pd-5"><strong>二级品类名称</strong></div>
                                <ul class="bk-gray pt-5" id="classSet2"></ul>
                            </div>
                            <div class="class-wp27 f-l" style="display: none" id="classDiv3">
                                <div class="pb-5"><strong>三级品类名称</strong></div>
                                <ul class="bk-gray pt-5" id="classSet3"></ul>
                            </div>
                            <div class="class-wp27 f-l" style="display: none" id="classDiv4">
                                <div class="pb-5"><strong>四级品类名称</strong></div>
                                <ul class="bk-gray pt-5" id="classSet4"></ul>
                            </div>
                        </div>
                        <div class="clearfix pb-20 HuiTab" id="tab_goods" style="margin-left:28px;width:90%">
                            <div class="tabBar clearfix"><span class="current" name="applProduct" value="1">适用商品</span><span name="applProduct" value="2">排除商品</span>
                                <div class="f-r pd-10"><a onclick="upLoadFile()">导入商品</a>
                                    <input id="fileUp" style="display: none" type="file" onchange="putDataToPage()">&nbsp;&nbsp;
                                    <a id="downloadProductExcelTemplate">下载模板</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="clearAll()">全部清空</a></div>
                            </div>
                            <div class="tabCon" id="tabbox1" style="display:block">
                                <div class="c-999 pd-10">适用以下商品：共<span id="applNumber">0</span>个</div>
                                <table>
                                    <tr>
                                        <td class="col-2-1 pl-20">SPU</td>
                                        <td class="col-2-1 pl-20">Code</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="formControls col-sm-11">
                                                <textarea name="abstract" class="textarea" id="spuText" title="" style="height:300px" onkeyup="testShuRu(this.value)" placeholder="商品与商品之间请用英文分号间隔，例如：016010 ; 05369" onchange="getNum(value)"></textarea>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="formControls col-sm-11">
                                                <textarea name="abstract" class="textarea" id="skuText" title="" style="height:300px" onkeyup="testShuRu(this.value)" placeholder="商品与商品之间请用英文分号间隔，例如：016010 ; 05369"onchange="getNum(value)"></textarea>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="tabCon" id="tabbox2">
                                <div class="c-999 pd-10">排除以下商品：共<span id="removeNumber">0</span>个</div>
                                <table>
                                    <tr>
                                        <td class="col-2-1 pl-20">SPU</td>
                                        <td class="col-2-1 pl-20">Code</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="formControls col-sm-11">
                                                <textarea name="abstract" class="textarea" id="spuText1" title="" style="height:300px" onkeyup="testShuRu(this.value)" placeholder="商品与商品之间请用英文分号间隔，例如：016010 ; 05369" onchange="getNum(value)"></textarea>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="formControls col-sm-11">
                                                <textarea name="abstract" class="textarea" id="skuText1" title="" style="height:300px" onkeyup="testShuRu(this.value)" placeholder="商品与商品之间请用英文分号间隔，例如：016010 ; 05369" onchange="getNum(value)"></textarea>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="text-c mb-10 ">
                    <input id="bottm" type="submit" class="btn btn-secondary radius size-S"
                           value="确&nbsp;&nbsp;认">
<!--                    <input id="refresh" type="button" class="btn btn-secondary radius size-S botter"-->
<!--                           value="&nbsp;测&nbsp;&nbsp;试&nbsp;" onclick="makeMap()">-->
                    <!--<input id="aaa" type="button" class="btn btn-secondary radius size-S botter"-->
                           <!--value="&nbsp;检&nbsp;&nbsp;查&nbsp;" onclick="check()">-->
                </div>
            </div>
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>

<!--表单验证-->
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../ht-js/Project.js?rev=@@hash"></script>
<script src="../../ht-js/coupon/coupon-topic-new.js?rev=@@hash"></script>
<script src="../../ht-js/coupon/coupon-topic.js?rev=@@hash"></script>
<script>
    //登录人员信息
    var loginData = JSON.parse(decodeURIComponent(web.readCookie("loginData")));
    console.log(loginData);
    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
        var $tab_menu = $(tabBar);
        // 初始化操作
        $tab_menu.removeClass(class_name);
        $(tabBar).eq(i).addClass(class_name);
        $(tabCon).hide();
        $(tabCon).eq(i).show();
        $tab_menu.bind(tabEvent, function () {
            $tab_menu.removeClass(class_name);
            $(this).addClass(class_name);
            var index = $tab_menu.index(this);
            $(tabCon).hide();
            $(tabCon).eq(index).show();
        });
    }
    $(function () {
        $.Huitab("#tab_goods .tabBar span", "#tab_goods .tabCon", "current", "click", "0");
        $('#createUsername').html(loginData.user.name);
        $('#createDept').html(loginData.department.department_NAME);
    });
    $('#reset').click(function(){
        $('input').val('');
    })
    $('#amount').keyup(function(){  
        this.value = this.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
        this.value = this.value.replace(/^\./g,""); //验证第一个字符是数字
        this.value = this.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
        this.value = this.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        this.value = this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
        if(this.value>10000)
            {this.value=10000;}
            var countPrice = parseFloat(this.value*$('#totalCount').val()).toFixed(2);
        $('#countPrice').html(countPrice)
    });
    $('#totalCount').keyup(function () {
        this.value=this.value.replace(/\D/g,'');
        if(this.value>100000)
            {this.value=100000;}
        var countPrice = parseFloat(this.value*$('#amount').val()).toFixed(2);
        $('#countPrice').html(countPrice)
        
    });
    $('#useCondition').keyup(function () {
        $('#radio-2').prop('checked',true)
        this.value = this.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
        this.value = this.value.replace(/^\./g,""); //验证第一个字符是数字
        this.value = this.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
        this.value = this.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        this.value = this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
        if(this.value>100000)
        {this.value=100000;}
    });
    $('#dayNumber').keyup(function(){
        this.value=this.value.replace(/\D/g,'');
        if(this.value==0){this.value="";}
    });
    $('#dayNumber').focus(function(){
        $('#radio-4').prop('checked',true);
        $('#timeDate').hide();
        $('#logmin').val('');
        $('#logmax').val('');
    });
    $('#logmin').focus(function () {
        $('#radio-3').prop('checked',true);
        $('#dayNumber').val('');
    });
    $('#logmax').focus(function () {
        $('#radio-3').prop('checked',true);
        $('#dayNumber').val('');
    })
    $('#downloadProductExcelTemplate').attr('href',root.couponInter.coupon_downloadProductExcelTemplate)
    /*$('#refresh').click(function (){
            setTimeout(function(){
                location.reload();
            },10000);
    })*/
    //全部清空
    function clearAll(){
        layer.confirm('您确定要全部清空？', function(index){
        $('#skuText').val('');
        $('#spuText').val('');
        $('#skuText1').val('');
        $('#spuText1').val('');
            $('#removeNumber').html(0);
			$('#applNumber').html(0);
            layer.close(index);
        });

    }
    function noCondition(){
        $('#useCondition').val('');
        $('#useCondition').focus();
    }
    function setDayNum() {
console.log(111);
        $('#timeDate').hide();
        $('#logmin').val('');
        $('#logmax').val('');
    }
    function setDayDate() {
        $('#timeDate').show();
        $('#dayNumber').readOnly;
        $('#dayNumber').val('');
    }
</script>
</body>
</html>